<%@page import="java.util.*"%>
<%@page import="java.text.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath(); 
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+path+ "/"; 
%>
<!DOCTYPE HTML>
<html>
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<title>消息列表</title>
	<link rel="stylesheet" href="plugin/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
	<link rel="stylesheet" href="css/bootstrap-datetimepicker.css" />
    <link rel="stylesheet" href="plugin/bootstrap-table/dist/bootstrap-table.css">
<style type="text/css">

ul{
    list-style-type: none;
}
 .breadcrumb{
          padding: 21px 25px;
       }  
 a {
    color: #2a3f54;
}        
</style>

</head>
<body>
    <div class="row base-margin" id="query">
        <ul class="breadcrumb">
				<li style="padding-left: 15px"><i class="icon-home home-icon"></i> <a href="javascript:void(0)">System Settings(系统设置)</a>
				</li>
				<li class="active">
				<a href="view/sys/message_list.jsp">All Notifications(消息推送列表)</a></li>
        </ul>
        <form class="form-inline" role="form" style="float: left; width: 100%" method="post" id="queryForm">
           
           <div class="form-group">  
                <label for="bName">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Notification time(推送时间):</label> 
                <input type="text" class="form-control input-append form_date"  id="startTime" />-
                <input type="text" class="form-control input-append form_date"   id="endTime" />
            </div>   
            <div class="form-group">
                <button type="button" id="queryBtn" onclick="doQuery1('demo-table',queryParams1());" class="btn btn-primary">Search(搜索)</button>
            </div> 
        </form>
    </div>
    <div class="container" style="width: 100%;margin-top:15px">
        <table id="demo-table">
        </table>
    </div>
</body>
	<!-- 加载需要的js -->
	<script src="js/jquery-3.2.1.min.js"></script>
	<script src="plugin/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
	<script src="js/jquery-bootstrap-pagination.js"></script>
	<script src="plugin/bootstrap-table/dist/bootstrap-table.min.js"></script>
	<script src="plugin/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script>
	<!--时间  -->
	<script src="js/bootstrap-datetimepicker.js"></script>
	<script src="js/bootstrap-datetimepicker.zh-CN.js"></script>
	<script src="js/common.js"></script>
	<script src="plugin/layer/layer.js"></script>
	<script type="text/javascript" charset="utf-8">
	$(function () {
		initPath("<%=basePath%>");
	    initTable('demo-table',queryParams,columns,"sugFeedback/getMessageList");
	});
	
	   $('.form_date').datetimepicker({
	        minView: "month", //选择日期后，不会再跳转去选择时分秒 
	        language: 'zh-CN',
	        format: 'dd/mm/yyyy',
	        todayBtn:  1,
	        autoclose: 1,
	    });
var  columns= [ 
	 { field : 'mName',  title : 'Notification Name(消息名称)',  align : 'center', valign : 'middle'},
	 { field : 'mSummary',  title : 'Notification Preview(消息概述)',  align : 'center', valign : 'middle' },
	 { field : 'name',  title : 'Rider Name(接收者账号)',  align : 'center', valign : 'middle' },
	 { field : 'telephone',  title : 'Rider Phone(接收者电话)',  align : 'center', valign : 'middle' },
	 { field : 'type',  title : 'Role(接收角色)',  align : 'center', valign : 'middle',formatter:function(value,row,index){
		 return value=="1"?"Rider(用户)":"Driver(司机)";
	 } },
	 { field : 'releaseName',  title : 'Publisher name(发布者名称)',  align : 'center', valign : 'middle' },
	 { field : 'mContext', title : 'Notification Content(消息内容)', align : 'center', valign : 'middle' },
     {  field : 'createTime',  title : 'Voucher Issue Time(发送时间)', align : 'center', valign : 'middle',formatter:timeStamp2String  },
     
	 ];

function cacel(){
	layer.closeAll();
}
	function queryParams(params) {
		 console.log(params);  
	    var param = {
    		startTime:$('#startTime').val(), 
    		endTime:$('#endTime').val(),
	        pageNo : this.pageNumber,
	        pageSize : this.pageSize
	    }	
	    return param;
	} 
	function queryParams1(){
		 var param = {
				startTime:$('#startTime').val(), 
		    	endTime:$('#endTime').val(),
		        pageNo : 1,
		        pageSize : this.pageSize
		    }	
		    return param;
	}
	</script>
</html>


